#include<vector>
#include<string>
#include<sstream>
#include <set>
class Solution {
public:
    std::vector<char> road;
    std::set<std::string> set;
 int len = 0;
    const char* chars;
    std::vector<std::string> generatePermutation(std::string s) {
         chars = s.c_str();

        len = s.length();
        cun(0);
        road.push_back(chars[0]);
        std::vector<std::string> ans ;
        for (auto basic_string : set)
        {
            ans.push_back(basic_string);
        }
        return ans;
    }

    std::string make ()
    {
        std::stringstream s ;
        for (char value : road)
        {
            s<<value;
        }
        return s.str();
    }
    void cun(int index)
    {
        if (index == len)
        {
            set.insert(make());
            return ;
        }
        cun(index+1);
        road.push_back(chars[index]);
        cun(index+1);
        road.pop_back();
    }
};
